package wxk.interview.serializable;

import java.io.*;

/**
 * @author wangxuekai
 * @version 2.2
 * @Date 2017/3/9.
 * @since 2.2
 */
public class PersonExternalize {

    public static void main(String[] args){

        File file = new File("personExt.out");

        try {
            ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(file));
            outputStream.writeObject(new PersonExt("123","wxk",27));

            ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(file));
            Object o = inputStream.readObject();
            System.out.println(o);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }

    }

}
